﻿using System.Windows.Forms;

namespace HAOest.Forms.Forms
{
    /// <summary>
    /// 空白窗口类，实现了一些实用方法
    /// </summary>
    public partial class BlankForm : Form
    {
        const int WS_MINIMIZEBOX = 0x20000;
        const int CS_DBLCLKS = 0x8;

        /// <summary>
        /// 构造函数
        /// </summary>
        public BlankForm()
        {
            InitializeComponent();
        }


        #region 以下代码使得窗口响应点击任务栏图标事件并解决了闪烁问题
        /// <summary>
        /// 覆写了CreateParams
        /// </summary>
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.Style |= WS_MINIMIZEBOX;
                cp.ClassStyle |= CS_DBLCLKS;
                //cp.ExStyle |= 0x02000000;       //为窗口和所有子控件添加双缓存。添加会导致设计器不显示的问题
                return cp;
            }
        }
        #endregion
    }
}
